<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message"/>
    
    <h:form id="cruzeiroForm">

        <rich:panel>
            <f:facet name="header">Cruzeiro</f:facet>
    
            <s:decorate id="numeroDecoration" template="layout/edit.xhtml">
                <ui:define name="label">Nome</ui:define>
                <h:inputText id="nome" required="true"
                             value="#{cruzeiroHome.instance.nome}"/>
            </s:decorate>
            
            <s:decorate id="saidaDecoration" template="layout/edit.xhtml">
                <ui:define name="label">Saida</ui:define>
                <a4j:outputPanel id="calendarioSaida" layout="block">			
					<rich:calendar value="#{cruzeiroHome.instance.saida}" 
                    	popup="true"
                        datePattern="dd/MM/yyy"
                        showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px"/>
                </a4j:outputPanel>
            </s:decorate>
            
            <s:decorate id="chegadaDecoration" template="layout/edit.xhtml">
                <ui:define name="label">Chegada</ui:define>
                <a4j:outputPanel id="calendarioSaida" layout="block">			
					<rich:calendar value="#{cruzeiroHome.instance.chegada}" 
                    	popup="true"
                        datePattern="dd/MM/yyy"
                        showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px"/>
                </a4j:outputPanel>
            </s:decorate>
                      
            <s:decorate id="navioDecoration" template="layout/edit.xhtml">
                <ui:define name="label">Navio</ui:define>
                <h:selectOneMenu value="#{cruzeiroHome.instance.navio}">
					<s:selectItems noSelectionLabel="Selecione.." value="#{navioList.resultList}" var="navio_" label="#{navio_.nome}">
						</s:selectItems>
					<s:convertEntity />
				</h:selectOneMenu>
            </s:decorate>
            
            <div style="clear:both"/>
            
        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="save" 
                          value="Save" 
                         action="#{cruzeiroHome.persist}"
                       rendered="#{!cruzeiroHome.managed}"/>                   
            <h:commandButton id="update" 
                          value="Save" 
                         action="#{cruzeiroHome.update}"
                       rendered="#{cruzeiroHome.managed}"/>                  
            <h:commandButton id="delete" 
                          value="Delete" 
                         action="#{cruzeiroHome.remove}"
                      immediate="true"
                       rendered="#{cruzeiroHome.managed}"/>
            <s:button propagation="end" 
                               id="done" 
                            value="Done"
                             view="/cruzeiroList.xhtml"/>
        </div>
        
    </h:form>
    
</ui:define>

</ui:composition>

